JOBID = {

	JT_NOVICE = 0,
	JT_SWORDMAN = 1,
	JT_MAGICIAN = 2,
	JT_ARCHER = 3,
	JT_ACOLYTE = 4,
	JT_MERCHANT = 5,
	JT_THIEF = 6,
	JT_KNIGHT = 7,
	JT_PRIEST = 8,
	JT_WIZARD = 9,
	JT_BLACKSMITH = 10,
	JT_HUNTER = 11,
	JT_ASSASSIN = 12,
	JT_CRUSADER = 14,
	JT_MONK = 15,
	JT_SAGE = 16,
	JT_ROGUE = 17,
	JT_ALCHEMIST = 18,
	JT_BARD = 19,
	JT_DANCER = 20,
	JT_SUPERNOVICE = 23,
	JT_GUNSLINGER = 24,
	JT_NINJA = 25,
	JT_NOVICE_H = 4001,
	JT_SWORDMAN_H = 4002,
	JT_MAGICIAN_H = 4003,
	JT_ARCHER_H = 4004,
	JT_ACOLYTE_H = 4005,
	JT_MERCHANT_H = 4006,
	JT_THIEF_H = 4007,
	JT_KNIGHT_H = 4008,
	JT_PRIEST_H = 4009,
	JT_WIZARD_H = 4010,
	JT_BLACKSMITH_H = 4011,
	JT_HUNTER_H = 4012,
	JT_ASSASSIN_H = 4013,
	JT_CRUSADER_H = 4015,
	JT_MONK_H = 4016,
	JT_SAGE_H = 4017,
	JT_ROGUE_H = 4018,
	JT_ALCHEMIST_H = 4019,
	JT_BARD_H = 4020,
	JT_DANCER_H = 4021,
	JT_NOVICE_B = 4023,
	JT_SWORDMAN_B = 4024,
	JT_MAGICIAN_B = 4025,
	JT_ARCHER_B = 4026,
	JT_ACOLYTE_B = 4027,
	JT_MERCHANT_B = 4028,
	JT_THIEF_B = 4029,
	JT_KNIGHT_B = 4030,
	JT_PRIEST_B = 4031,
	JT_WIZARD_B = 4032,
	JT_BLACKSMITH_B = 4033,
	JT_HUNTER_B = 4034,
	JT_ASSASSIN_B = 4035,
	JT_CRUSADER_B = 4037,
	JT_MONK_B = 4038,
	JT_SAGE_B = 4039,
	JT_ROGUE_B = 4040,
	JT_ALCHEMIST_B = 4041,
	JT_BARD_B = 4042,
	JT_DANCER_B = 4043,
	JT_SUPERNOVICE_B = 4045,
	JT_TAEKWON = 4046,
	JT_STAR = 4047,
	JT_LINKER = 4049,
	JT_RUNE_KNIGHT = 4054,
	JT_WARLOCK = 4055,
	JT_RANGER = 4056,
	JT_ARCHBISHOP = 4057,
	JT_MECHANIC = 4058,
	JT_GUILLOTINE_CROSS = 4059,
	JT_RUNE_KNIGHT_H = 4060,
	JT_WARLOCK_H = 4061,
	JT_RANGER_H = 4062,
	JT_ARCHBISHOP_H = 4063,
	JT_MECHANIC_H = 4064,
	JT_GUILLOTINE_CROSS_H = 4065,
	JT_ROYAL_GUARD = 4066,
	JT_SORCERER = 4067,
	JT_MINSTREL = 4068,
	JT_WANDERER = 4069,
	JT_SURA = 4070,
	JT_GENETIC = 4071,
	JT_SHADOW_CHASER = 4072,
	JT_ROYAL_GUARD_H = 4073,
	JT_SORCERER_H = 4074,
	JT_MINSTREL_H = 4075,
	JT_WANDERER_H = 4076,
	JT_SURA_H = 4077,
	JT_GENETIC_H = 4078,
	JT_SHADOW_CHASER_H = 4079,
	JT_RUNE_KNIGHT_B = 4096,
	JT_WARLOCK_B = 4097,
	JT_RANGER_B = 4098,
	JT_ARCHBISHOP_B = 4099,
	JT_MECHANIC_B = 4100,
	JT_GUILLOTINE_CROSS_B = 4101,
	JT_ROYAL_GUARD_B = 4102,
	JT_SORCERER_B = 4103,
	JT_MINSTREL_B = 4104,
	JT_WANDERER_B = 4105,
	JT_SURA_B = 4106,
	JT_GENETIC_B = 4107,
	JT_SHADOW_CHASER_B = 4108
}

JOB_INHERIT_LIST = {

	[JOBID.JT_SWORDMAN] = JOBID.JT_NOVICE,
	[JOBID.JT_MAGICIAN] = JOBID.JT_NOVICE,
	[JOBID.JT_ARCHER] = JOBID.JT_NOVICE,	
	[JOBID.JT_ACOLYTE] = JOBID.JT_NOVICE,
	[JOBID.JT_MERCHANT] = JOBID.JT_NOVICE,
	[JOBID.JT_THIEF] = JOBID.JT_NOVICE,
	[JOBID.JT_KNIGHT] = JOBID.JT_SWORDMAN,
	[JOBID.JT_PRIEST] = JOBID.JT_ACOLYTE,
	[JOBID.JT_WIZARD] = JOBID.JT_MAGICIAN,
	[JOBID.JT_BLACKSMITH] = JOBID.JT_MERCHANT,
	[JOBID.JT_HUNTER] = JOBID.JT_ARCHER,
	[JOBID.JT_ASSASSIN] = JOBID.JT_THIEF,
	[JOBID.JT_CRUSADER] = JOBID.JT_SWORDMAN,
	[JOBID.JT_MONK] = JOBID.JT_ACOLYTE,
	[JOBID.JT_SAGE] = JOBID.JT_MAGICIAN,
	[JOBID.JT_ROGUE] = JOBID.JT_THIEF,
	[JOBID.JT_ALCHEMIST] = JOBID.JT_MERCHANT,
	[JOBID.JT_BARD] = JOBID.JT_ARCHER,
	[JOBID.JT_DANCER] = JOBID.JT_ARCHER,
	[JOBID.JT_SUPERNOVICE] = JOBID.JT_NOVICE,
	[JOBID.JT_GUNSLINGER] = JOBID.JT_NOVICE,
	[JOBID.JT_NINJA] = JOBID.JT_NOVICE,
	[JOBID.JT_NOVICE_H] = JOBID.JT_NOVICE,
	[JOBID.JT_SWORDMAN_H] = JOBID.JT_SWORDMAN,
	[JOBID.JT_MAGICIAN_H] = JOBID.JT_MAGICIAN,
	[JOBID.JT_ARCHER_H] = JOBID.JT_ARCHER,
	[JOBID.JT_ACOLYTE_H] = JOBID.JT_ACOLYTE,
	[JOBID.JT_MERCHANT_H] = JOBID.JT_MERCHANT,
	[JOBID.JT_THIEF_H] = JOBID.JT_THIEF,
	[JOBID.JT_KNIGHT_H] = JOBID.JT_KNIGHT,
	[JOBID.JT_PRIEST_H] = JOBID.JT_PRIEST,
	[JOBID.JT_WIZARD_H] = JOBID.JT_WIZARD,
	[JOBID.JT_BLACKSMITH_H] = JOBID.JT_BLACKSMITH,
	[JOBID.JT_HUNTER_H] = JOBID.JT_HUNTER,
	[JOBID.JT_ASSASSIN_H] = JOBID.JT_ASSASSIN,
	[JOBID.JT_CRUSADER_H] = JOBID.JT_CRUSADER,
	[JOBID.JT_MONK_H] = JOBID.JT_MONK,
	[JOBID.JT_SAGE_H] = JOBID.JT_SAGE,
	[JOBID.JT_ROGUE_H] = JOBID.JT_ROGUE,
	[JOBID.JT_ALCHEMIST_H] = JOBID.JT_ALCHEMIST,
	[JOBID.JT_BARD_H] = JOBID.JT_BARD,
	[JOBID.JT_DANCER_H] = JOBID.JT_DANCER,
	[JOBID.JT_NOVICE_B] = JOBID.JT_NOVICE,
	[JOBID.JT_SWORDMAN_B] = JOBID.JT_SWORDMAN,
	[JOBID.JT_MAGICIAN_B] = JOBID.JT_MAGICIAN,
	[JOBID.JT_ARCHER_B] = JOBID.JT_ARCHER,	
	[JOBID.JT_ACOLYTE_B] = JOBID.JT_ACOLYTE,
	[JOBID.JT_MERCHANT_B] = JOBID.JT_MERCHANT,
	[JOBID.JT_THIEF_B] = JOBID.JT_THIEF,
	[JOBID.JT_KNIGHT_B] = JOBID.JT_KNIGHT,
	[JOBID.JT_PRIEST_B] = JOBID.JT_PRIEST,
	[JOBID.JT_WIZARD_B] = JOBID.JT_WIZARD,
	[JOBID.JT_BLACKSMITH_B] = JOBID.JT_BLACKSMITH,
	[JOBID.JT_HUNTER_B] = JOBID.JT_HUNTER,
	[JOBID.JT_ASSASSIN_B] = JOBID.JT_ASSASSIN,
	[JOBID.JT_CRUSADER_B] = JOBID.JT_CRUSADER,
	[JOBID.JT_MONK_B] = JOBID.JT_MONK,
	[JOBID.JT_SAGE_B] = JOBID.JT_SAGE,
	[JOBID.JT_ROGUE_B] = JOBID.JT_ROGUE,
	[JOBID.JT_ALCHEMIST_B] = JOBID.JT_ALCHEMIST,
	[JOBID.JT_BARD_B] = JOBID.JT_BARD,
	[JOBID.JT_DANCER_B] = JOBID.JT_DANCER,
	[JOBID.JT_SUPERNOVICE_B] = JOBID.JT_SUPERNOVICE,
	[JOBID.JT_TAEKWON] = JOBID.JT_NOVICE,
	[JOBID.JT_STAR] = JOBID.JT_TAEKWON,
	[JOBID.JT_LINKER] = JOBID.JT_TAEKWON,
	[JOBID.JT_RUNE_KNIGHT] = JOBID.JT_KNIGHT,
	[JOBID.JT_WARLOCK] = JOBID.JT_WIZARD,
	[JOBID.JT_RANGER] = JOBID.JT_HUNTER,
	[JOBID.JT_ARCHBISHOP] = JOBID.JT_PRIEST,
	[JOBID.JT_MECHANIC] = JOBID.JT_BLACKSMITH,
	[JOBID.JT_GUILLOTINE_CROSS] = JOBID.JT_ASSASSIN,	
	[JOBID.JT_RUNE_KNIGHT_H] = JOBID.JT_KNIGHT_H,
	[JOBID.JT_WARLOCK_H] = JOBID.JT_WIZARD_H,
	[JOBID.JT_RANGER_H] = JOBID.JT_HUNTER_H,
	[JOBID.JT_ARCHBISHOP_H] = JOBID.JT_PRIEST_H,
	[JOBID.JT_MECHANIC_H] = JOBID.JT_BLACKSMITH_H,
	[JOBID.JT_GUILLOTINE_CROSS_H] = JOBID.JT_ASSASSIN_H,
	[JOBID.JT_ROYAL_GUARD] = JOBID.JT_CRUSADER,
	[JOBID.JT_SORCERER] = JOBID.JT_SAGE,
	[JOBID.JT_MINSTREL] = JOBID.JT_BARD,
	[JOBID.JT_WANDERER] = JOBID.JT_DANCER,
	[JOBID.JT_SURA] = JOBID.JT_MONK,
	[JOBID.JT_GENETIC] = JOBID.JT_ALCHEMIST,	
	[JOBID.JT_SHADOW_CHASER] = JOBID.JT_ROGUE,
	[JOBID.JT_ROYAL_GUARD_H] = JOBID.JT_CRUSADER_H,
	[JOBID.JT_SORCERER_H] = JOBID.JT_SAGE_H,
	[JOBID.JT_MINSTREL_H] = JOBID.JT_BARD_H,
	[JOBID.JT_WANDERER_H] = JOBID.JT_DANCER_H,
	[JOBID.JT_SURA_H] = JOBID.JT_MONK_H,
	[JOBID.JT_GENETIC_H] = JOBID.JT_ALCHEMIST_H,
	[JOBID.JT_SHADOW_CHASER_H] = JOBID.JT_ROGUE_H,
	[JOBID.JT_RUNE_KNIGHT_B] = JOBID.JT_RUNE_KNIGHT,
	[JOBID.JT_WARLOCK_B] = JOBID.JT_WARLOCK,
	[JOBID.JT_RANGER_B] = JOBID.JT_RANGER,
	[JOBID.JT_ARCHBISHOP_B] = JOBID.JT_ARCHBISHOP,
	[JOBID.JT_MECHANIC_B] = JOBID.JT_MECHANIC,
	[JOBID.JT_GUILLOTINE_CROSS_B] = JOBID.JT_GUILLOTINE_CROSS,
	[JOBID.JT_ROYAL_GUARD_B] = JOBID.JT_ROYAL_GUARD,
	[JOBID.JT_SORCERER_B] = JOBID.JT_SORCERER,
	[JOBID.JT_MINSTREL_B] = JOBID.JT_MINSTREL,
	[JOBID.JT_WANDERER_B] = JOBID.JT_WANDERER,
	[JOBID.JT_SURA_B] = JOBID.JT_SURA,
	[JOBID.JT_GENETIC_B] = JOBID.JT_GENETIC,
	[JOBID.JT_SHADOW_CHASER_B] = JOBID.JT_SHADOW_CHASER,
	["__newindex"] = function () error("unknown state") end
}
setmetatable(JOB_INHERIT_LIST, JOB_INHERIT_LIST)

JOB_INHERIT_LIST2 = {

	[JOBID.JT_RUNE_KNIGHT_H] = JOBID.JT_RUNE_KNIGHT,
	[JOBID.JT_WARLOCK_H] = JOBID.JT_WARLOCK,
	[JOBID.JT_RANGER_H] = JOBID.JT_RANGER,
	[JOBID.JT_ARCHBISHOP_H] = JOBID.JT_ARCHBISHOP,
	[JOBID.JT_MECHANIC_H] = JOBID.JT_MECHANIC,
	[JOBID.JT_GUILLOTINE_CROSS_H] = JOBID.JT_GUILLOTINE_CROSS,
	[JOBID.JT_ROYAL_GUARD_H] = JOBID.JT_ROYAL_GUARD,
	[JOBID.JT_SORCERER_H] = JOBID.JT_SORCERER,
	[JOBID.JT_MINSTREL_H] = JOBID.JT_MINSTREL,
	[JOBID.JT_WANDERER_H] = JOBID.JT_WANDERER,
	[JOBID.JT_SURA_H] = JOBID.JT_SURA,
	[JOBID.JT_GENETIC_H] = JOBID.JT_GENETIC,
	[JOBID.JT_SHADOW_CHASER_H] = JOBID.JT_SHADOW_CHASER,
	["__newindex"] = function () error("unknown state") end
}
setmetatable(JOB_INHERIT_LIST2, JOB_INHERIT_LIST2)